import {createApp} from "vue";
import App from "./App.vue";

import "@themeGeeker/styles/var.scss";
// reset style sheet
import "@themeGeeker/styles/reset.scss";
// CSS common style sheet
import "@themeGeeker/styles/common.scss";
// iconfont css
import "@themeGeeker/assets/iconfont/iconfont.scss";
// font css
import "@themeGeeker/assets/fonts/font.scss";
// element css
import "element-plus/dist/index.css";
// element dark css
import "element-plus/theme-chalk/dark/css-vars.css";
// custom element dark css
import "@themeGeeker/styles/element-dark.scss";
// custom element css
import "@themeGeeker/styles/element.scss";
import "uno.css";
// svg icons
import "virtual:svg-icons-register";
// element plus
import ElementPlus from "element-plus";
// element icons
import * as Icons from "@element-plus/icons-vue";
// custom directives
import directives from "@themeGeeker/directives/index";
// vue Router
import router from "@themeGeeker/routers";
// vue i18n
import I18n from "@themeGeeker/languages/index";
// pinia store
import pinia from "@themeGeeker/stores";
// errorHandler
import errorHandler from "@themeGeeker/utils/errorHandler";

const app = createApp(App);

app.config.errorHandler = errorHandler;

// register the element Icons component
Object.keys(Icons).forEach(key => {
  app.component(key, Icons[key as keyof typeof Icons]);
});

app.use(ElementPlus).use(directives).use(I18n).use(pinia).use(router).mount("#app");
